package com.ywjt.pinkelephant.my.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ywjt.pinkelephant.R;
import com.ywjt.pinkelephant.base.BaseActivity;
import com.ywjt.pinkelephant.widget.PickWithDrawMethodDialog;

public class ActivityWithDraw extends BaseActivity implements View.OnClickListener {
private TextView tvMethod;
private EditText etNumber;
private LinearLayout llCard;

    public static void actionStart(Context context ) {
        Intent intent = new Intent(context, ActivityWithDraw.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tvMethod:
                PickWithDrawMethodDialog dialog=new PickWithDrawMethodDialog();
                dialog.setClicklistener(new PickWithDrawMethodDialog.ClickListenerInterface() {
                    @Override
                    public void card() {
                        tvMethod.setText("请选择提现方式：银行卡");
                        llCard.setVisibility(View.VISIBLE);
                        etNumber.setHint("请输入账户号码");
                        dialog.dismiss();
                    }

                    @Override
                    public void ali() {
                        tvMethod.setText("请选择提现方式：支付宝");
                        etNumber.setHint("请输入手机号");
                        llCard.setVisibility(View.GONE);
                        dialog.dismiss();
                    }

                    @Override
                    public void wx() {
                        tvMethod.setText("请选择提现方式：微信");
                        etNumber.setHint("请输入手机号");
                        llCard.setVisibility(View.GONE);
                        dialog.dismiss();
                    }
                });
                dialog.show(getSupportFragmentManager());
                break;
        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_withdraw;
    }

    @Override
    protected void initView() {
        setTitleText("可提现余额");
        tvMethod=findViewById(R.id.tvMethod);
        llCard=findViewById(R.id.llCard);
        etNumber=findViewById(R.id.etNumber);
        tvMethod.setOnClickListener(this::onClick);

    }

    @Override
    protected void initData() {

    }

    /**
     * 获取要使用的标题栏样式(此函数由子类重写)
     * @return
     */
    @Override
    protected int getTitleBarType() {
        return 0;
    }

}
